﻿namespace EyFramework.ORM
{
    /// <summary>
    /// 抽象HIS的公共接口
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public interface IBaseHisDao<T> : IBaseDao<T> where T : class, new()
    {
        /// <summary>
        /// 获取指定表的最大值，通过调用SPRF.GETMAXID获取
        /// </summary>
        /// <param name="tableName">表名</param>
        /// <param name="fieldName">字段名</param>
        /// <returns></returns>
        long GetHisMaxId(string tableName, string fieldName);

        /// <summary>
        /// 取当前时间
        /// </summary>
        /// <param name="formatStr"></param>
        /// <returns></returns>
        string GetCurrentDate(string formatStr = "YYYY-MM-DD HH24:MI:SS");

        /// <summary>
        /// 获取序列的值,没有则创建他
        /// </summary>
        /// <param name="sequenceName"></param>
        /// <param name="createFlag"></param>
        /// <returns></returns>
        long GetSequence(string sequenceName, bool createFlag = true);
    }
}